package com.enid.rongtalkdemo;

import android.content.Context;
import android.content.SharedPreferences;

public class PreferenceUtil {

    public static void putString(Context context, String key,String value){
        SharedPreferences sharedPreferences =  context.getSharedPreferences(ConstantUtil.PREFERENCES_FILENAME,Context.MODE_PRIVATE);
        SharedPreferences.Editor edit = sharedPreferences.edit();
        edit.putString(key, (String) value).commit();
    }

    public static String getString(Context context,String key){
        SharedPreferences sharedPreferences =  context.getSharedPreferences(ConstantUtil.PREFERENCES_FILENAME,Context.MODE_PRIVATE);
        String string = sharedPreferences.getString(key, "");
        return string;
    }
}
